package com.chenfan.mcn.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chenfan.mcn.model.CustomerTarget;
import com.chenfan.mcn.model.McnPage;
import com.chenfan.mcn.model.dto.CustomerTargetDTO;
import com.chenfan.mcn.model.dto.CustomerTargetSearchDTO;
import com.chenfan.mcn.model.vo.CustomerTargetPageVO;
import com.chenfan.mcn.model.vo.QuarterTargetPageVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 重点客户目标 服务类
 * </p>
 *
 * @author lizhejin
 * @since 2021-04-22
 */
public interface CustomerTargetService extends IService<CustomerTarget> {

    /**
     * 新增重点客户目标
     *
     * @param customerTargetList
     * @return Integer
     */
    Integer addTarget(List<CustomerTargetDTO> customerTargetList);

    /**
     * 重点客户目标详情
     *
     * @param id
     * @return {@link CustomerTargetDTO}
     */
    CustomerTargetDTO targetDetail(Long id);

    /**
     * 重点客户目标删除
     *
     * @param id
     * @return Integer
     */
    Integer deleteTarget(Long id);

    /**
     * 重点客户目标编辑
     *
     * @param customerTargetDTO {@link CustomerTargetDTO}
     * @return Integer
     */
    Integer updateTarget(CustomerTargetDTO customerTargetDTO);

    /**
     * 客户目标按客户维度分页列表
     *
     * @param mcnPage                 {@link McnPage}
     * @param customerTargetSearchDTO {@link CustomerTargetSearchDTO}
     * @return
     */
    Page<CustomerTargetPageVO> customerTargetPage(McnPage<CustomerTargetPageVO> mcnPage, CustomerTargetSearchDTO customerTargetSearchDTO);

    /**
     * 导出重点客户目标
     *
     * @param customerTargetSearchDTO {@link CustomerTargetSearchDTO}
     * @param response                {@link HttpServletResponse}
     */
    void exportTarget(CustomerTargetSearchDTO customerTargetSearchDTO, HttpServletResponse response);

    /**
     * 季度销售额更新落库
     *
     * @return Integer
     */
    void updateQuarterSales();

    /**
     * 客户目标指定客户下季度维度分页列表
     *
     * @param mcnPage    {@link McnPage}
     * @param customerId
     * @return
     */
    Page<QuarterTargetPageVO> quarterTargetPage(McnPage<QuarterTargetPageVO> mcnPage, Long customerId);

    /**
     * 导入Excel、
     *
     * @param multipartFile {@link MultipartFile}
     * @return Integer
     */
    String excelImport(MultipartFile multipartFile);

    /**
     * 下载失败原因
     *
     * @param response {@link HttpServletResponse}
     * @param fileId
     */
    void excelDownload(HttpServletResponse response, String fileId);
}
